# -*- coding: utf-8 -*-
"""
Created on Wed Apr 24 13:04:48 2019

@author: yaoyu
"""

if 0:
    tf = open('f.txt', 'rt', encoding='utf8')
    print(tf.readline())
    tf.close()
    
    tf = open('f.txt', 'rb')
    print(tf.readline())
    tf.close()
    
    tf = open('f.txt', 'rt', encoding='utf8')
    print(tf.read())
    tf.close()

    
tf = open('f.txt', 'rt', encoding='utf8')
txt = tf.read(2)
while len(txt):
    txt = tf.read(2)
    print(txt)
tf.close()
